package com.ruoyi.device.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
public class DeviceBorrow extends BaseEntity {

    private static final  long serialVersionUID = 1L ;

    /**
     * 主键
     */
    private Long borrowId;
    /**
     * 设备id
     */
    private Long deviceId;

   @Excels({
           @Excel(name = "设备", targetAttr = "deviceName", type = Excel.Type.EXPORT),
           @Excel(name = "型号", targetAttr = "deviceModel", type = Excel.Type.EXPORT)
   })
    private DeviceInfo device;

    /**
     * 借用用户id
     */
    private Long userId;

    /**
     * 查询时的借用人姓名
     */
    private String userName;

    @Excels({
            @Excel(name = "部门", targetAttr = "dept.deptName", type=Excel.Type.EXPORT),
            @Excel(name = "工号/学号", targetAttr = "userName", type=Excel.Type.EXPORT),
            @Excel(name = "姓名", targetAttr = "nickName", type=Excel.Type.EXPORT)
    })
    private SysUser user;

    /**
     * 借用时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "借用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date borrowTime;

    /**
     * 借用说明
     */
    @Excel(name = "借用说明")
    private String borrowRemark;

    /**
     * 计划归还时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划归还时间" ,width = 30, dateFormat = "yyyy-MM-dd")
    private Date returnTime;
    /**
     * 归还状态，0未归还 ， 1已归还
     */
    @Excel(name = "归还状态,0未归还,1已归还")
    private Integer returnStatus;
    /**
     * 归还说明
     */
    @Excel(name = "归还说明")
    private String returnRemark;
    /**
     * 设备状态
     */
    private Integer deviceStatus;
}
